package com.starlink.model.util;

import com.starlink.model.dtomapper.FreeDeliverySetDtoMapper;
import com.starlink.model.domain.FreeDeliverySetDO;
import com.starlink.model.vo.FreeDeliverySetVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class FreeDeliverySetConvert {

    public static List<FreeDeliverySetVO> buildFreeDeliverySetVoList(List<FreeDeliverySetDO> freeDeliverySetDOList) {
        if (CollectionUtils.isEmpty(freeDeliverySetDOList)) {
            return Lists.newArrayList();
        }
        List<FreeDeliverySetVO> freeDeliverySetVOList = new ArrayList<>();
        for (FreeDeliverySetDO freeDeliverySetDO : freeDeliverySetDOList) {
            freeDeliverySetVOList.add(FreeDeliverySetDtoMapper.INSTANCE.do2VO(freeDeliverySetDO));
        }

        return freeDeliverySetVOList;
    }
}
